<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .dl {
            font-size: 20px;

        }

        .bg {
            width: 100%;
            height: 100vh;
            display: flex;
            justify-content: center;
            align-items: center;
        }

        .bg1 {
            width: 100%;
            height: 500px;
            background-color: rgb(229, 240, 249);
            margin: 0 auto;
            display: flex;


        }

        .gallery {
            margin-left: 200px;
            margin-top: 0px;
            width: 500px;
            height: 500px;
        }

        .table {

            width: 500px;
            height: 400px;
            border: 1px solid black;
            margin-left: 200px;
            margin-top: 50px;
            border-radius: 40px;
        }

        .anniu {
            list-style: none;
            display: flex;
            flex-wrap: wrap;
           justify-content: flex-start;
           margin-left: -17px;


        }

        .bao {
            margin-top: 30px;
            display: flex;
            align-items: center;
            flex-direction: column;
        }
        

        .zhuce {
            width: 300px;
            height: 30px;
            /* margin-top: 8px;
            margin-left: 45px; */
            text-align: center;
            line-height: 30px;
        }

        .nihao {
            margin: 0;
            padding: 0;
            margin-left: 110px;
            font-size: 30px;
            color: black;
        }

        .no {
            /* background-color: aqua; */
            width: 100px;
            height: 10px;
            display: inline-block;
            margin: 15px

        }

        .haha{
            margin: 0;
            padding: 0;
            margin-left: 50px;
            font-size: 30px;
            
            color: black;
        }
        a{
            text-decoration: none;
        }

        .btn{
            width: 100px;
            height: 30px;
            margin-top: 20px;
        }
    </style>
</head>

<body>


    <div class="bg">
        <div class="bg1">
            <div>
                <img class="gallery" src="./yl.png" alt="">
            </div>
            <div class="table">
                <a href="登录注册.html"><span class="nihao">注册账号</span></a>
                <a href="登录.html"><span class="haha">登录账号</span></a>
                <ul class="bao">
                    <li class="anniu">
                        <!-- <span class="no">用户名：</span><input type="text" class="zhuce"><br> -->
                        <!-- <span class="no">性别：</span><input type="text" class="zhuce"><br>
                        <span class="no">身份证：</span><input type="text" class="zhuce"><br>
                        <span class="no">邮箱:</span><input type="text" class="zhuce"><br> -->
                        <span class="no">手机号：</span><input type="text" class="zhuce" id="phone"><br>
                        <span class="no">密码：</span><input type="text" class="zhuce" id="password"><br>

                    </li>
                    <button class="btn" >登录</button>
                </ul>
            </div>
        </div>

    </div>

    <script src="./jquery-1.8.3.min.js"></script>
    <script>

        $(".btn").click(function () {
            $.ajax({
                url: "http://172.16.106.87:8080/login",
                type: "get",
                data: {
                    phone: $("#phone").val(),
                    password: $("#password").val()
                    // username: $(".username").val(),
                    // emali: $(".emali").val(),
                    // idCode: $(".idCode").val(),
                    // sex: $(".sex").val(),

                },
                success: function (data) {

                    console.log(data);
                    if(data.code==200){
                        alert("登陆成功")
                        localStorage.setItem("useradd",JSON.stringify(data))
                    }else{
                        alert(data.message)
                    }
                    

                }
            })
        })


    </script>
</body>

</html>